/*
 * Copyright (c) 2014. kupat Corporation. All rights reserved.
 *  see statement on http://www.kupat.cn.
 */
package com.kfgj.hkp.common.dataaccess.mybatis;


import com.kfgj.hkp.common.BaseEntity;
import com.kfgj.hkp.common.dataaccess.IBaseDao;
import com.kfgj.hkp.common.dataaccess.PageResult;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * Created by liwensihan on 2014/11/6.
 *
 * @author liwensihan
 */
public interface IMyBatisBaseDao<T extends BaseEntity, PK extends Serializable> extends IBaseDao<T, PK> {

    int selectCount(String statement, Map<String, Object> param);

    int countByMap(Map<String, Object> param);

    List<T> selectByMap(Map<String, Object> queryParam);

    List<T> selectByMap(Map<String, Object> queryParam, String orderBy, boolean isAsc);

    PageResult<T> selectByMap(Map<String, Object> queryParam, int start, int pageSize);

    PageResult<T> selectByMap(Map<String, Object> queryParam, int start, int pageSize, String orderBy, boolean isAsc);

    List<T> selectByStatement(String statement, Map<String, Object> queryParam);

    List<T> selectByStatement(String statement, Map<String, Object> queryParam, String orderBy, boolean isAsc);

    PageResult<T> selectByStatement(String statement, Map<String, Object> queryParam, int start, int pageSize);

    PageResult<T> selectByStatement(String statement, Map<String, Object> queryParam, int start, int pageSize, String orderBy, boolean isAsc);

    T selectUniqueByProp(String propertyName, Object value);

    T selectUniqueByMap(Map<String, Object> param);

}


